# app: main.o hello.o
# 	gcc main.o hello.o -o app 

# main.o: main.c
# 	gcc -c main.c -I hello

# hello.o: hello/hello.c
# 	gcc -c hello/hello.c
	
# clean:
# 	rm -rf main.o hello.o app


# 高阶版
TARGET = app
SRCS = main.c hello/hello.c
INC = -Ihello
OJBS = $(SRCS:.c=.o)

$(TARGET): $(OJBS)
	echo $(OJBS)
	$(CC) -o $@ $^

%.o: %.c
	$(CC) $(INC) -o $@ -c $<

clean:
	rm -rf $(TARGET) $(OJBS)
